package jianzhi

func isStraight(nums []int) bool {

	zeroNums := 0
	min, max := 13, 1

	numCount := map[int]int{}

	for _, v := range nums {

		if v == 0 {
			zeroNums++
			continue
		}

		if _, ok := numCount[v]; ok {
			return false
		}

		numCount[v] = 1
		if v < min {
			min = v
		}
		if v > max {
			max = v
		}
	}

	if max-min+1 == len(nums) || max-min+1 < len(nums) {
		return true
	}

	return false

}
